<!-- HTML header for doxygen 1.8.6-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<title>OpenCV: Aruco module FAQ</title>
<link href="../../opencv.ico" rel="shortcut icon" type="image/x-icon" />
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<script type="text/javascript" src="../../tutorial-utils.js"></script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/searchdata.js"></script>
<script type="text/javascript" src="../../search/search.js"></script>
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    extensions: ["tex2jax.js", "TeX/AMSmath.js", "TeX/AMSsymbols.js"],
    jax: ["input/TeX","output/HTML-CSS"],
});
//<![CDATA[
MathJax.Hub.Config(
{
  TeX: {
      Macros: {
          matTT: [ "\\[ \\left|\\begin{array}{ccc} #1 & #2 & #3\\\\ #4 & #5 & #6\\\\ #7 & #8 & #9 \\end{array}\\right| \\]", 9],
          fork: ["\\left\\{ \\begin{array}{l l} #1 & \\mbox{#2}\\\\ #3 & \\mbox{#4}\\\\ \\end{array} \\right.", 4],
          forkthree: ["\\left\\{ \\begin{array}{l l} #1 & \\mbox{#2}\\\\ #3 & \\mbox{#4}\\\\ #5 & \\mbox{#6}\\\\ \\end{array} \\right.", 6],
          forkfour: ["\\left\\{ \\begin{array}{l l} #1 & \\mbox{#2}\\\\ #3 & \\mbox{#4}\\\\ #5 & \\mbox{#6}\\\\ #7 & \\mbox{#8}\\\\ \\end{array} \\right.", 8],
          vecthree: ["\\begin{bmatrix} #1\\\\ #2\\\\ #3 \\end{bmatrix}", 3],
          vecthreethree: ["\\begin{bmatrix} #1 & #2 & #3\\\\ #4 & #5 & #6\\\\ #7 & #8 & #9 \\end{bmatrix}", 9],
          cameramatrix: ["#1 = \\begin{bmatrix} f_x & 0 & c_x\\\\ 0 & f_y & c_y\\\\ 0 & 0 & 1 \\end{bmatrix}", 1],
          distcoeffs: ["(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6 [, s_1, s_2, s_3, s_4[, \\tau_x, \\tau_y]]]]) \\text{ of 4, 5, 8, 12 or 14 elements}"],
          distcoeffsfisheye: ["(k_1, k_2, k_3, k_4)"],
          hdotsfor: ["\\dots", 1],
          mathbbm: ["\\mathbb{#1}", 1],
          bordermatrix: ["\\matrix{#1}", 1]
      }
  }
}
);
//]]>
</script><script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js"></script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
<link href="../../stylesheet.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<!--#include virtual="/google-search.html"-->
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="../../opencv-logo-small.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">OpenCV
   &#160;<span id="projectnumber">4.5.2</span>
   </div>
   <div id="projectbrief">Open Source Computer Vision</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "../../search",false,'Search');
</script>
<script type="text/javascript" src="../../menudata.js"></script>
<script type="text/javascript" src="../../menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('../../',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="../../d3/d81/tutorial_contrib_root.html">Tutorials for contrib modules</a></li><li class="navelem"><a class="el" href="../../d9/d6d/tutorial_table_of_content_aruco.html">ArUco marker detection (aruco module)</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">Aruco module FAQ </div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p>This is a compilation of questions that can be useful for those that want to use the aruco module.</p>
<ul>
<li>I only want to label some objects, what should I use?</li>
</ul>
<p>In this case, you only need single ArUco markers. You can place one or several markers with different ids in each of the object you want to identify.</p>
<ul>
<li>Which algorithm is used for marker detection?</li>
</ul>
<p>The aruco module is based on the original ArUco library. A full description of the detection process can be found in:</p>
<blockquote class="doxtable">
<p>S. Garrido-Jurado, R. Muñoz-Salinas, F. J. Madrid-Cuevas, and M. J. Marín-Jiménez. 2014. "Automatic generation and detection of highly reliable fiducial markers under occlusion". Pattern Recogn. 47, 6 (June 2014), 2280-2292. DOI=10.1016/j.patcog.2014.01.005 </p>
</blockquote>
<ul>
<li>My markers are not being detected correctly, what can I do?</li>
</ul>
<p>There can be many factors that avoid the correct detection of markers. You probably need to adjust some of the parameters in the <code>DetectorParameters</code> object. The first thing you can do is checking if your markers are returned as rejected candidates by the <code><a class="el" href="../../d9/d6a/group__aruco.html#gab9159aa69250d8d3642593e508cb6baa" title="Basic marker detection. ">detectMarkers()</a></code> function. Depending on this, you should try to modify different parameters.</p>
<p>If you are using a ArUco board, you can also try the <code><a class="el" href="../../d9/d6a/group__aruco.html#ga13a2742381c0a48e146d230a8cda2e66" title="Refind not detected markers based on the already detected and the board layout. ">refineDetectedMarkers()</a></code> function.</p>
<ul>
<li>What are the benefits of ArUco boards? What are the drawbacks?</li>
</ul>
<p>Using a board of markers you can obtain the camera pose from a set of markers, instead of a single one. This way, the detection is able to handle occlusion of partial views of the Board, since only one marker is necessary to obtain the pose.</p>
<p>Furthermore, as in most cases you are using more corners for pose estimation, it will be more accurate than using a single marker.</p>
<p>The main drawback is that a Board is not as versatile as a single marker.</p>
<ul>
<li>What are the benefits of ChArUco boards over ArUco boards? And the drawbacks?</li>
</ul>
<p>ChArUco boards combines chessboards with ArUco boards. Thanks to this, the corners provided by ChArUco boards are more accurate than those provided by ArUco Boards (or single markers).</p>
<p>The main drawback is that ChArUco boards are not as versatile as ArUco board. For instance, a ChArUco board is a planar board with a specific marker layout while the ArUco boards can have any layout, even in 3d. Furthermore, the markers in the ChArUco board are usually smaller and more difficult to detect.</p>
<ul>
<li>I do not need pose estimation, should I use ChArUco boards?</li>
</ul>
<p>No. The main goal of ChArUco boards is provide high accurate corners for pose estimation or camera calibration.</p>
<ul>
<li>Should all the markers in an ArUco board be placed in the same plane?</li>
</ul>
<p>No, the marker corners in a ArUco board can be placed anywhere in its 3d coordinate system.</p>
<ul>
<li>Should all the markers in an ChArUco board be placed in the same plane?</li>
</ul>
<p>Yes, all the markers in a ChArUco board need to be in the same plane and their layout is fixed by the chessboard shape.</p>
<ul>
<li>What is the difference between a <code>Board</code> object and a <code>GridBoard</code> object?</li>
</ul>
<p>The <code>GridBoard</code> class is a specific type of board that inherits from <code>Board</code> class. A <code>GridBoard</code> object is a board whose markers are placed in the same plane and in a grid layout.</p>
<ul>
<li>What are Diamond markers?</li>
</ul>
<p>Diamond markers are very similar to a ChArUco board of 3x3 squares. However, contrary to ChArUco boards, the detection of diamonds is based on the relative position of the markers. They are useful when you want to provide a conceptual meaning to any (or all) of the markers in the diamond. An example is using one of the marker to provide the diamond scale.</p>
<ul>
<li>Do I need to detect marker before board detection, ChArUco board detection or Diamond detection?</li>
</ul>
<p>Yes, the detection of single markers is a basic tool in the aruco module. It is done using the <code><a class="el" href="../../d9/d6a/group__aruco.html#gab9159aa69250d8d3642593e508cb6baa" title="Basic marker detection. ">detectMarkers()</a></code> function. The rest of functionalities receives a list of detected markers from this function.</p>
<ul>
<li>I want to calibrate my camera, can I use this module?</li>
</ul>
<p>Yes, the aruco module provides functionalities to calibrate the camera using both, ArUco boards and ChArUco boards.</p>
<ul>
<li>Should I calibrate using a ChArUco board or an ArUco board?</li>
</ul>
<p>It is highly recommended the calibration using ChArUco board due to the high accuracy.</p>
<ul>
<li>Should I use a predefined dictionary or generate my own dictionary?</li>
</ul>
<p>In general, it is easier to use one of the predefined dictionaries. However, if you need a bigger dictionary (in terms of number of markers or number of bits) you should generate your own dictionary. Dictionary generation is also useful if you want to maximize the inter-marker distance to achieve a better error correction during the identification step.</p>
<ul>
<li>I am generating my own dictionary but it takes too long</li>
</ul>
<p>Dictionary generation should only be done once at the beginning of your application and it should take some seconds. If you are generating the dictionary on each iteration of your detection loop, you are doing it wrong.</p>
<p>Furthermore, it is recommendable to save the dictionary to a file and read it on every execution so you dont need to generate it.</p>
<ul>
<li>I would like to use some markers of the original ArUco library that I have already printed, can I use them?</li>
</ul>
<p>Yes, one of the predefined dictionary is <code>DICT_ARUCO_ORIGINAL</code>, which detects the marker of the original ArUco library with the same identifiers.</p>
<ul>
<li>Can I use the Board configuration file of the original ArUco library in this module?</li>
</ul>
<p>Not directly, you will need to adapt the information of the ArUco file to the aruco module Board format.</p>
<ul>
<li>Can I use this module to detect the markers of other libraries based on binary fiducial markers?</li>
</ul>
<p>Probably yes, however you will need to port the dictionary of the original library to the aruco module format.</p>
<ul>
<li>Do I need to store the Dictionary information in a file so I can use it in different executions?</li>
</ul>
<p>If you are using one of the predefined dictionaries, it is not necessary. Otherwise, it is recommendable that you save it to file.</p>
<ul>
<li>Do I need to store the Board information in a file so I can use it in different executions?</li>
</ul>
<p>If you are using a <code>GridBoard</code> or a <code>ChArUco</code> board you only need to store the board measurements that are provided to the <code>GridBoard::create()</code> or <code>ChArUco::create()</code> functions. If you manually modify the marker ids of the boards, or if you use a different type of board, you should save your board object to file.</p>
<ul>
<li>Does the aruco module provide functions to save the Dictionary or Board to file?</li>
</ul>
<p>Not right now. However the data member of both the dictionary and board classes are public and can be easily stored.</p>
<ul>
<li>Alright, but how can I render a 3d model to create an augmented reality application?</li>
</ul>
<p>To do so, you will need to use an external rendering engine library, such as OpenGL. The aruco module only provides the functionality to obtain the camera pose, i.e. the rotation and traslation vectors, which is necessary to create the augmented reality effect. However, you will need to adapt the rotation and traslation vectors from the OpenCV format to the format accepted by your 3d rendering library. The original ArUco library contains examples of how to do it for OpenGL and Ogre3D.</p>
<ul>
<li>I have use this module in my research work, how can I cite it?</li>
</ul>
<p>You can cite the original ArUco library:</p>
<blockquote class="doxtable">
<p>S. Garrido-Jurado, R. Muñoz-Salinas, F. J. Madrid-Cuevas, and M. J. Marín-Jiménez. 2014. "Automatic generation and detection of highly reliable fiducial markers under occlusion". Pattern Recogn. 47, 6 (June 2014), 2280-2292. DOI=10.1016/j.patcog.2014.01.005</p>
</blockquote>
</div></div><!-- contents -->
<!-- HTML footer for doxygen 1.8.6-->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Fri Apr 2 2021 11:36:38 for OpenCV by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="../../doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
<script type="text/javascript">
//<![CDATA[
addTutorialsButtons();
//]]>
</script>
</body>
</html>
